# 0-10的列表
list1 = [i for i in range(3)]
list2=[7,8,9]
print(list1)

# 带if
list3 =[i for i in range(11) if i%2==0]
print(list2)

# 字典推导式（两个列表转换的推导式，列表中数据的个数要一致）
dict1 ={list1[i]:list2[i] for i in range(len(list1))}
print(dict1)

list1 = ['name', 'age', 'gender']
list2 = ['Tom', 20, 'man']
dict1 = {list1[i]: list2[i] for i in range(len(list1))}
print(dict1)

# 集合推导式
set1 = {i**2 for i in range(4)}
print(set1)

